package b.f.l;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.os.Build;
import android.view.View;
import android.view.animation.Interpolator;
import java.lang.ref.WeakReference;

public final class w {

    /* renamed from: a  reason: collision with root package name */
    private WeakReference<View> f1353a;

    /* renamed from: b  reason: collision with root package name */
    Runnable f1354b = null;

    /* renamed from: c  reason: collision with root package name */
    Runnable f1355c = null;

    /* renamed from: d  reason: collision with root package name */
    int f1356d = -1;

    class a extends AnimatorListenerAdapter {

        /* renamed from: a  reason: collision with root package name */
        final /* synthetic */ x f1357a;

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ View f1358b;

        a(w wVar, x xVar, View view) {
            this.f1357a = xVar;
            this.f1358b = view;
        }

        public void onAnimationCancel(Animator animator) {
            this.f1357a.c(this.f1358b);
        }

        public void onAnimationEnd(Animator animator) {
            this.f1357a.a(this.f1358b);
        }

        public void onAnimationStart(Animator animator) {
            this.f1357a.b(this.f1358b);
        }
    }

    class b implements ValueAnimator.AnimatorUpdateListener {

        /* renamed from: a  reason: collision with root package name */
        final /* synthetic */ z f1359a;

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ View f1360b;

        b(w wVar, z zVar, View view) {
            this.f1359a = zVar;
            this.f1360b = view;
        }

        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            this.f1359a.a(this.f1360b);
        }
    }

    static class c implements x {

        /* renamed from: a  reason: collision with root package name */
        w f1361a;

        /* renamed from: b  reason: collision with root package name */
        boolean f1362b;

        c(w wVar) {
            this.f1361a = wVar;
        }

        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v5, resolved type: java.lang.Object} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r2v2, resolved type: b.f.l.x} */
        /* JADX WARNING: Multi-variable type inference failed */
        @android.annotation.SuppressLint({"WrongConstant"})
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public void a(android.view.View r4) {
            /*
                r3 = this;
                b.f.l.w r0 = r3.f1361a
                int r0 = r0.f1356d
                r1 = -1
                r2 = 0
                if (r0 <= r1) goto L_0x000f
                r4.setLayerType(r0, r2)
                b.f.l.w r0 = r3.f1361a
                r0.f1356d = r1
            L_0x000f:
                int r0 = android.os.Build.VERSION.SDK_INT
                r1 = 16
                if (r0 >= r1) goto L_0x0019
                boolean r0 = r3.f1362b
                if (r0 != 0) goto L_0x0039
            L_0x0019:
                b.f.l.w r0 = r3.f1361a
                java.lang.Runnable r1 = r0.f1355c
                if (r1 == 0) goto L_0x0024
                r0.f1355c = r2
                r1.run()
            L_0x0024:
                r0 = 2113929216(0x7e000000, float:4.2535296E37)
                java.lang.Object r0 = r4.getTag(r0)
                boolean r1 = r0 instanceof b.f.l.x
                if (r1 == 0) goto L_0x0031
                r2 = r0
                b.f.l.x r2 = (b.f.l.x) r2
            L_0x0031:
                if (r2 == 0) goto L_0x0036
                r2.a(r4)
            L_0x0036:
                r4 = 1
                r3.f1362b = r4
            L_0x0039:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: b.f.l.w.c.a(android.view.View):void");
        }

        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v5, resolved type: java.lang.Object} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r1v2, resolved type: b.f.l.x} */
        /* JADX WARNING: Multi-variable type inference failed */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public void b(android.view.View r4) {
            /*
                r3 = this;
                r0 = 0
                r3.f1362b = r0
                b.f.l.w r0 = r3.f1361a
                int r0 = r0.f1356d
                r1 = 0
                r2 = -1
                if (r0 <= r2) goto L_0x000f
                r0 = 2
                r4.setLayerType(r0, r1)
            L_0x000f:
                b.f.l.w r0 = r3.f1361a
                java.lang.Runnable r2 = r0.f1354b
                if (r2 == 0) goto L_0x001a
                r0.f1354b = r1
                r2.run()
            L_0x001a:
                r0 = 2113929216(0x7e000000, float:4.2535296E37)
                java.lang.Object r0 = r4.getTag(r0)
                boolean r2 = r0 instanceof b.f.l.x
                if (r2 == 0) goto L_0x0027
                r1 = r0
                b.f.l.x r1 = (b.f.l.x) r1
            L_0x0027:
                if (r1 == 0) goto L_0x002c
                r1.b(r4)
            L_0x002c:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: b.f.l.w.c.b(android.view.View):void");
        }

        public void c(View view) {
            Object tag = view.getTag(2113929216);
            x xVar = tag instanceof x ? (x) tag : null;
            if (xVar != null) {
                xVar.c(view);
            }
        }
    }

    w(View view) {
        this.f1353a = new WeakReference<>(view);
    }

    private void g(View view, x xVar) {
        if (xVar != null) {
            view.animate().setListener(new a(this, xVar, view));
        } else {
            view.animate().setListener((Animator.AnimatorListener) null);
        }
    }

    public w a(float f) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().alpha(f);
        }
        return this;
    }

    public void b() {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().cancel();
        }
    }

    public long c() {
        View view = (View) this.f1353a.get();
        if (view != null) {
            return view.animate().getDuration();
        }
        return 0;
    }

    public w d(long j) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().setDuration(j);
        }
        return this;
    }

    public w e(Interpolator interpolator) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().setInterpolator(interpolator);
        }
        return this;
    }

    public w f(x xVar) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            if (Build.VERSION.SDK_INT < 16) {
                view.setTag(2113929216, xVar);
                xVar = new c(this);
            }
            g(view, xVar);
        }
        return this;
    }

    public w h(long j) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().setStartDelay(j);
        }
        return this;
    }

    public w i(z zVar) {
        View view = (View) this.f1353a.get();
        if (view != null && Build.VERSION.SDK_INT >= 19) {
            b bVar = null;
            if (zVar != null) {
                bVar = new b(this, zVar, view);
            }
            view.animate().setUpdateListener(bVar);
        }
        return this;
    }

    public void j() {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().start();
        }
    }

    public w k(float f) {
        View view = (View) this.f1353a.get();
        if (view != null) {
            view.animate().translationY(f);
        }
        return this;
    }
}
